﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Text.Json.Serialization;

namespace USERS.CYT369.COM.MODELS.Articles
{
    public class UserDocCategory : BaseObject<long>
    {
        /// <summary>
        /// 所属用户
        /// </summary>
        public long UserID { get; set; }

        public long ParentID { get; set; }

        /// <summary>
        /// 类型名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 说明备注
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// 排序号
        /// </summary>
        public int Sequence { get; set; }

        [JsonIgnore]
        public UserDocCategory Parent { get; set; }


        [JsonIgnore]
        public ICollection<UserDocCategory> SubTypes { get; set; } = new HashSet<UserDocCategory>();

        #region view modles
        public long id
        {
            get { return this.Id; }
        }
        public string text
        {
            get
            {
                return this.Name;
            }
        }
        public string state { get; set; } = "open";
        public ICollection<UserDocCategory> children
        {
            get
            {
                return this.SubTypes;
            }
        }
        #endregion

    }

}
